# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contributor: Dan Ziemba <zman0900@gmail.com>
# Contributor: Christoph Zeiler <archNOSPAM_at_moonblade.dot.org>

pkgname=lbzip2
pkgver=2.5
pkgrel=5
pkgdesc="A parallel, SMP-based, bzip2-compatible compression utility"
arch=('loong64' 'x86_64')
url="http://lbzip2.org"
license=('GPL3')
depends=('glibc')
makedepends=('patch')
source=(http://deb.debian.org/debian/pool/main/l/$pkgname/${pkgname}_${pkgver}.orig.tar.bz2
        lbzip2-gnulib-build-fix.patch)
sha256sums=('eec4ff08376090494fa3710649b73e5412c3687b4b9b758c93f73aa7be27555b'
            '5eca4665b147655ce99f9ae5eff50e7db2714ba957e41e20b50d80533aeb6bef')

prepare() {
  cd "${srcdir}"/$pkgname-$pkgver

  patch -Np1 -i "${srcdir}"/lbzip2-gnulib-build-fix.patch
}

build() {
  cd "${srcdir}"/$pkgname-$pkgver
 
  ./configure --prefix=/usr
  make
}

check() {
  cd "${srcdir}"/$pkgname-$pkgver
  
  make check
}

package() {
  cd "${srcdir}"/$pkgname-$pkgver
 
  make DESTDIR="${pkgdir}" install
}
